\hypertarget{classc_ground}{\section{c\-Ground类 参考}
\label{classc_ground}\index{c\-Ground@{c\-Ground}}
}


基础地板，用于当参照物。 可以运行在固定管道或\-S\-H\-A\-D\-E\-R；  




{\ttfamily \#include $<$c\-Ground.\-h$>$}

\subsection*{Public 成员函数}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classc_ground_acd40d9fcd7b0bba9a1af55e129496974}{c\-Ground} (I\-Direct3\-D\-Device9 $\ast$p\-Device, const \hyperlink{struct_terrain}{Terrain} \&t)
\item 
void \hyperlink{classc_ground_ac9e3c4a3ba0e69ea3c30d2b1c1af3775}{init\-\_\-ground} (D3\-D\-X\-V\-E\-C\-T\-O\-R3 Center=Zero)
\begin{DoxyCompactList}\small\item\em 用的\-C\-O\-L\-O\-R\-\_\-\-F\-V\-F创建顶点缓冲。 \end{DoxyCompactList}\item 
void \hyperlink{classc_ground_a9b3dcd1497270dec6e15cb62225d70d1}{draw\-\_\-ground} (int i)
\begin{DoxyCompactList}\small\item\em 渲染网格。 \end{DoxyCompactList}\item 
void \hyperlink{classc_ground_a91ae278ddc8a49efe2fc8895557e2d67}{draw\-\_\-ground} (\hyperlink{classc_vertex_decl}{c\-Vertex\-Decl} $\ast$p\-Vertex\-Decl)
\begin{DoxyCompactList}\small\item\em 渲染网格。 \end{DoxyCompactList}\item 
\hypertarget{classc_ground_adbb9343a4b2e12e9ab0c6f61f41e3367}{void \hyperlink{classc_ground_adbb9343a4b2e12e9ab0c6f61f41e3367}{init\-\_\-color\-\_\-ground} (D3\-D\-X\-V\-E\-C\-T\-O\-R3 Center=Zero, D3\-D\-X\-C\-O\-L\-O\-R Color1=G\-R\-A\-Y, D3\-D\-X\-C\-O\-L\-O\-R Color2=B\-L\-A\-C\-K)}\label{classc_ground_adbb9343a4b2e12e9ab0c6f61f41e3367}

\begin{DoxyCompactList}\small\item\em 创建顶点格式有，颜色地形。 \end{DoxyCompactList}\item 
\hypertarget{classc_ground_abc14d0f94f916dfecff6c089ee40d1c5}{void \hyperlink{classc_ground_abc14d0f94f916dfecff6c089ee40d1c5}{init\-\_\-light\-\_\-ground} (D3\-D\-X\-V\-E\-C\-T\-O\-R3 Center=Zero)}\label{classc_ground_abc14d0f94f916dfecff6c089ee40d1c5}

\begin{DoxyCompactList}\small\item\em 创建顶点格式有，法线地形。 \end{DoxyCompactList}\item 
void \hyperlink{classc_ground_a8bfbe85e12fa0a7fe4d17bb4db41a644}{init\-\_\-tex\-\_\-ground} (D3\-D\-X\-V\-E\-C\-T\-O\-R3 Center=Zero, float Scale=1.\-0f)
\begin{DoxyCompactList}\small\item\em 创建顶点格式有，法线，纹理地形。 纹理坐标在\mbox{[}0,+infinite\mbox{]}。 \end{DoxyCompactList}\item 
\hypertarget{classc_ground_a8fbe7e39d57f075f82c347ffc92de732}{void \hyperlink{classc_ground_a8fbe7e39d57f075f82c347ffc92de732}{init\-\_\-tex\-\_\-ground\-V1} (D3\-D\-X\-V\-E\-C\-T\-O\-R3 Center=Zero)}\label{classc_ground_a8fbe7e39d57f075f82c347ffc92de732}

\begin{DoxyCompactList}\small\item\em 创建顶点格式有，法线，纹理地形。 纹理坐标控制在\mbox{[}0,1\mbox{]}。 \end{DoxyCompactList}\item 
void \hyperlink{classc_ground_a3542ae5dc722502d41c8622be404f19b}{init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-mesh} (\hyperlink{classc_vertex_decl}{c\-Vertex\-Decl} $\ast$p\-Vertex\-Decl, \hyperlink{classc_height_map}{c\-Height\-Map} $\ast$p\-Height\-Map, D3\-D\-X\-V\-E\-C\-T\-O\-R3 Center=Zero, bool b\-Optimize=true)
\begin{DoxyCompactList}\small\item\em 生成地形网格。 \end{DoxyCompactList}\item 
\hypertarget{classc_ground_a4a03bf1094d7dc6dd16b236c1a8e1d13}{void \hyperlink{classc_ground_a4a03bf1094d7dc6dd16b236c1a8e1d13}{draw\-\_\-light\-\_\-tex\-\_\-mesh\-\_\-\-Ground} ()}\label{classc_ground_a4a03bf1094d7dc6dd16b236c1a8e1d13}

\begin{DoxyCompactList}\small\item\em 渲染网格，仅一行代码：\-\_\-p\-Mesh-\/$>$Draw\-Subset(0); \end{DoxyCompactList}\item 
void \hyperlink{classc_ground_aa2b0848f0b8222a09a4f6a69cc0ad94d}{init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-sub\-\_\-mesh} (\hyperlink{classc_vertex_decl}{c\-Vertex\-Decl} $\ast$p\-Vertex\-Decl, \hyperlink{classc_height_map}{c\-Height\-Map} $\ast$p\-Height\-Map, D3\-D\-X\-V\-E\-C\-T\-O\-R3 Center=Zero)
\begin{DoxyCompactList}\small\item\em 生成地形。 \end{DoxyCompactList}\item 
\hypertarget{classc_ground_aaddd7dd3b174fcf7836e114ebffb916a}{void \hyperlink{classc_ground_aaddd7dd3b174fcf7836e114ebffb916a}{draw\-\_\-light\-\_\-tex\-\_\-sub\-\_\-mesh\-\_\-ground} ()}\label{classc_ground_aaddd7dd3b174fcf7836e114ebffb916a}

\begin{DoxyCompactList}\small\item\em 渲染地形。 内部是循环渲染子地形块。 \end{DoxyCompactList}\item 
\hypertarget{classc_ground_a52dd90812d5dbb10703c2dc38ff10c73}{float \hyperlink{classc_ground_a52dd90812d5dbb10703c2dc38ff10c73}{get\-\_\-light\-\_\-tex\-Ground\-\_\-sub\-\_\-mesh\-\_\-\-Y} (\hyperlink{classc_height_map}{c\-Height\-Map} $\ast$p\-Height\-Map, float Row, float Col)}\label{classc_ground_a52dd90812d5dbb10703c2dc38ff10c73}

\begin{DoxyCompactList}\small\item\em 给出位置得到所处的高度 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected 成员函数}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classc_ground_aafa93a358aa970dccce4ed1a07b0f99b}{void \hyperlink{classc_ground_aafa93a358aa970dccce4ed1a07b0f99b}{sub\-\_\-mesh} (R\-E\-C\-T \&Rect, vector$<$ \hyperlink{struct_light_texture_vertex_v1}{Light\-Texture\-Vertex\-V1} $>$ \&Gobal\-Vertex, \hyperlink{classc_vertex_decl}{c\-Vertex\-Decl} $\ast$p\-Vertex\-Decl)}\label{classc_ground_aafa93a358aa970dccce4ed1a07b0f99b}

\begin{DoxyCompactList}\small\item\em 被init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-sub\-\_\-mesh（）内部调用。 \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{详细描述}
基础地板，用于当参照物。 可以运行在固定管道或\-S\-H\-A\-D\-E\-R； 

\subsection{构造及析构函数说明}
\hypertarget{classc_ground_acd40d9fcd7b0bba9a1af55e129496974}{\index{c\-Ground@{c\-Ground}!c\-Ground@{c\-Ground}}
\index{c\-Ground@{c\-Ground}!cGround@{c\-Ground}}
\subsubsection[{c\-Ground}]{\setlength{\rightskip}{0pt plus 5cm}c\-Ground\-::c\-Ground (
\begin{DoxyParamCaption}
\item[{I\-Direct3\-D\-Device9 $\ast$}]{p\-Device, }
\item[{const {\bf Terrain} \&}]{t}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classc_ground_acd40d9fcd7b0bba9a1af55e129496974}
\begin{DoxyRemark}{备注}
要确保\-Terrain中的单元大小是2的倍数。 
\end{DoxyRemark}

\begin{DoxyParams}{参数}
{\em t,\-:} & 地形属性结构体，存放地形的相关数据。 \\
\hline
\end{DoxyParams}


\subsection{成员函数说明}
\hypertarget{classc_ground_a9b3dcd1497270dec6e15cb62225d70d1}{\index{c\-Ground@{c\-Ground}!draw\-\_\-ground@{draw\-\_\-ground}}
\index{draw\-\_\-ground@{draw\-\_\-ground}!cGround@{c\-Ground}}
\subsubsection[{draw\-\_\-ground}]{\setlength{\rightskip}{0pt plus 5cm}void c\-Ground\-::draw\-\_\-ground (
\begin{DoxyParamCaption}
\item[{int}]{i}
\end{DoxyParamCaption}
)}}\label{classc_ground_a9b3dcd1497270dec6e15cb62225d70d1}


渲染网格。 


\begin{DoxyParams}{参数}
{\em i,\-:} & 0默认线框输出，1可以输出点阵，2可以\-S\-O\-L\-I\-D输出; \\
\hline
\end{DoxyParams}
\hypertarget{classc_ground_a91ae278ddc8a49efe2fc8895557e2d67}{\index{c\-Ground@{c\-Ground}!draw\-\_\-ground@{draw\-\_\-ground}}
\index{draw\-\_\-ground@{draw\-\_\-ground}!cGround@{c\-Ground}}
\subsubsection[{draw\-\_\-ground}]{\setlength{\rightskip}{0pt plus 5cm}void c\-Ground\-::draw\-\_\-ground (
\begin{DoxyParamCaption}
\item[{{\bf c\-Vertex\-Decl} $\ast$}]{p\-Vertex\-Decl}
\end{DoxyParamCaption}
)}}\label{classc_ground_a91ae278ddc8a49efe2fc8895557e2d67}


渲染网格。 

\begin{DoxyRemark}{备注}
通用渲染办法。 针对init\-\_\-ground();p\-Vertex\-Decl创建时要使用\-C\-O\-L\-O\-R\-\_\-\-F\-V\-F。 如果传入的是\-L\-I\-G\-H\-T\-\_\-\-T\-E\-X\-T\-U\-R\-E\-\_\-\-F\-V\-F的话会渲染错误，线路紊乱状。 
\end{DoxyRemark}

\begin{DoxyParams}{参数}
{\em p\-Vertex\-Decl,\-:} & 顶点格式类。 \\
\hline
\end{DoxyParams}
\hypertarget{classc_ground_ac9e3c4a3ba0e69ea3c30d2b1c1af3775}{\index{c\-Ground@{c\-Ground}!init\-\_\-ground@{init\-\_\-ground}}
\index{init\-\_\-ground@{init\-\_\-ground}!cGround@{c\-Ground}}
\subsubsection[{init\-\_\-ground}]{\setlength{\rightskip}{0pt plus 5cm}void c\-Ground\-::init\-\_\-ground (
\begin{DoxyParamCaption}
\item[{D3\-D\-X\-V\-E\-C\-T\-O\-R3}]{Center = {\ttfamily Zero}}
\end{DoxyParamCaption}
)}}\label{classc_ground_ac9e3c4a3ba0e69ea3c30d2b1c1af3775}


用的\-C\-O\-L\-O\-R\-\_\-\-F\-V\-F创建顶点缓冲。 


\begin{DoxyParams}{参数}
{\em Center,\-:} & 地形的原点,从而可以改变地形的位置。 \\
\hline
\end{DoxyParams}
\hypertarget{classc_ground_a3542ae5dc722502d41c8622be404f19b}{\index{c\-Ground@{c\-Ground}!init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-mesh@{init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-mesh}}
\index{init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-mesh@{init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-mesh}!cGround@{c\-Ground}}
\subsubsection[{init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-mesh}]{\setlength{\rightskip}{0pt plus 5cm}void c\-Ground\-::init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-mesh (
\begin{DoxyParamCaption}
\item[{{\bf c\-Vertex\-Decl} $\ast$}]{p\-Vertex\-Decl, }
\item[{{\bf c\-Height\-Map} $\ast$}]{p\-Height\-Map, }
\item[{D3\-D\-X\-V\-E\-C\-T\-O\-R3}]{Center = {\ttfamily Zero}, }
\item[{bool}]{b\-Optimize = {\ttfamily true}}
\end{DoxyParamCaption}
)}}\label{classc_ground_a3542ae5dc722502d41c8622be404f19b}


生成地形网格。 


\begin{DoxyParams}{参数}
{\em p\-Vertex\-Decl,\-:} & 必须是\-L\-I\-G\-H\-T\-\_\-\-T\-E\-X\-T\-U\-R\-E\-\_\-\-F\-V\-F创建的。 \\
\hline
{\em p\-Height\-Map,\-:} & 外部高度图。 \\
\hline
{\em Center,\-:} & 网格的原点，用以调整位置。 \\
\hline
{\em b\-Optimize,\-:} & 是否优化网格顶点数据; \\
\hline
\end{DoxyParams}
\begin{DoxyRemark}{备注}
内部创建整块网格存放地形数据。 U\-V【0,1】 
\end{DoxyRemark}
\hypertarget{classc_ground_aa2b0848f0b8222a09a4f6a69cc0ad94d}{\index{c\-Ground@{c\-Ground}!init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-sub\-\_\-mesh@{init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-sub\-\_\-mesh}}
\index{init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-sub\-\_\-mesh@{init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-sub\-\_\-mesh}!cGround@{c\-Ground}}
\subsubsection[{init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-sub\-\_\-mesh}]{\setlength{\rightskip}{0pt plus 5cm}void c\-Ground\-::init\-\_\-light\-\_\-tex\-\_\-ground\-\_\-sub\-\_\-mesh (
\begin{DoxyParamCaption}
\item[{{\bf c\-Vertex\-Decl} $\ast$}]{p\-Vertex\-Decl, }
\item[{{\bf c\-Height\-Map} $\ast$}]{p\-Height\-Map, }
\item[{D3\-D\-X\-V\-E\-C\-T\-O\-R3}]{Center = {\ttfamily Zero}}
\end{DoxyParamCaption}
)}}\label{classc_ground_aa2b0848f0b8222a09a4f6a69cc0ad94d}


生成地形。 


\begin{DoxyParams}{参数}
{\em p\-Vertex\-Decl,\-:} & 必须是\-L\-I\-G\-H\-T\-\_\-\-T\-E\-X\-T\-U\-R\-E\-\_\-\-F\-V\-F创建的。 \\
\hline
{\em p\-Height\-Map,\-:} & 外部高度图。 \\
\hline
{\em Center,\-:} & 网格的原点，用以调整位置。 \\
\hline
\end{DoxyParams}
\begin{DoxyRemark}{备注}
内部创建整块网格存放地形数据，整块网格分解成若干子网格，整块网格被释放。 
\end{DoxyRemark}
\hypertarget{classc_ground_a8bfbe85e12fa0a7fe4d17bb4db41a644}{\index{c\-Ground@{c\-Ground}!init\-\_\-tex\-\_\-ground@{init\-\_\-tex\-\_\-ground}}
\index{init\-\_\-tex\-\_\-ground@{init\-\_\-tex\-\_\-ground}!cGround@{c\-Ground}}
\subsubsection[{init\-\_\-tex\-\_\-ground}]{\setlength{\rightskip}{0pt plus 5cm}void c\-Ground\-::init\-\_\-tex\-\_\-ground (
\begin{DoxyParamCaption}
\item[{D3\-D\-X\-V\-E\-C\-T\-O\-R3}]{Center = {\ttfamily Zero}, }
\item[{float}]{Scale = {\ttfamily 1.0f}}
\end{DoxyParamCaption}
)}}\label{classc_ground_a8bfbe85e12fa0a7fe4d17bb4db41a644}


创建顶点格式有，法线，纹理地形。 纹理坐标在\mbox{[}0,+infinite\mbox{]}。 


\begin{DoxyParams}{参数}
{\em Scale,\-:} & 缩放地图的\-U\-V值，这样调节重复次数。 \\
\hline
\end{DoxyParams}


该类的文档由以下文件生成\-:\begin{DoxyCompactItemize}
\item 
E\-:/!代码工厂/3\-D引擎/c\-Ground.\-h\item 
E\-:/!代码工厂/3\-D引擎/c\-Ground.\-cpp\end{DoxyCompactItemize}
